#include<iostream>
#include<vector>
using namespace std;


class Solution {
public:
    bool canJump(vector<int>& nums) {
        // vector<long long> tmpVt;
        // tmpVt.resize(nums.size() + 1);
        int left_step = 0;
        int n = nums.size();
        if (n == 1) return true;
        for (int i = 0; i < n - 1; i++) {
            left_step = max(left_step, nums[i]);
            if (left_step <= 0) return false;
            --left_step;
        }
        return true;
    }
};